import java.util.Scanner;

public class Test4 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        final double p = in.nextDouble();

        long cs = 0L; // 抽取次数
        double qw = 0; // 期望

        while (cs++ < 100000) {
            cs++;
            if (cs % 90 == 0) {
                qw += getP(cs, 1) * cs;
            } else {
                qw += getP(cs, p) * cs;
            }


        }
        System.out.println(qw);
    }

    static double getP(long cs, double p) {
        double cp = 1;
        for (int i = 0; i < cs - 1; i++) {
            if (i % 90 != 0) {
                cp *= 1 - p;
            }
        }
        cp *= p;
        return cp;
    }


}
